<template>
  <div>
    <el-button type="primary" @click="login">登录</el-button>
    <el-button type="primary" @click="userInfo">登录</el-button>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { reqLogin, reqUserInfo } from '@/api/user'

const state = ref({
  username: 'admin',
  password: '111111'
})
const login = async () => {
  const res = await reqLogin(state.value.username, state.value.password)
  console.log(res.data)
}

const userInfo = async () => {
  const res = await reqUserInfo()
  console.log(res.data)
}
</script>

<script lang="ts">
export default {
  name: 'VTest'
}
</script>

<style lang="scss" scoped></style>
